Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • xumix 17 posts 109 karma points c-trib
    May 12, 2014 @ 17:39
    xumix
    0

    Api controller actions do not respect [System.Web.Mvc.HttpGet] attributes

    For example, I use

    [System.Web.Mvc.HttpGet]
    public void NotifyUpdated(string authKey, DateTime date)

    But still get

    <Message>The requested resource does not support http method 'GET'.</Message>

    Same thing happens for all POST/PUT and other methods

  • Jan Skovgaard 11258 posts 23500 karma points MVP 7x admin c-trib
    May 12, 2014 @ 22:52
    Jan Skovgaard
    0

    Hi Xumix

    What version of Umbraco are you using?

    /Jan

  • xumix 17 posts 109 karma points c-trib
    May 13, 2014 @ 09:23
    xumix
    100

    I should use System.Net.Http.HttpGet

  • Damian Green 452 posts 1433 karma points
    May 13, 2014 @ 11:03
    Damian Green
    0

    I also had that if I didn't prefix my methods with the word Get (and I believe you don't need the attribute then - someone may correct me on that).

    So you could have

    public void GetNotifyUpdated(string authKey, DateTime date)
    
  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies